<template>
	<view>
		<z-paging ref="paging" autowire-list-name="dataList" autowire-query-name="getList">
			<view class="main">
					<block v-if="dataList.length>0"></block>
					<JobItem v-for="(item,index) in dataList" :key="index" :data="item" @jobItemClick="jobItemClick"></JobItem>
					</block>
					<block v-if="dataList.length == 0">
						<view class="empty-img">
							<image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/icon50.png"></image>
							<label>暂无内容</label>
						</view>
					</block>
			</view>
		</z-paging>
	</view>
</template>

<script>
	// import Index from "@/common/index-model.js"
	import Index from "@/common/index-model.js"
	let index = new Index();
	let that = null;
	export default {

		data() {
			return {
				dataList: [],
				title: '这是标题',
				content: '这是内容',
				type: 0
			}
		},
		onLoad(option) {
			console.log('传过来的值是', option.index)
			uni.setStorage({
				key: 'index',
				data: option.index,
				success: () => {
					console.log('存入成功')
				}
			})
			this.type = option.index
		},
		methods: {
			jobItemClick(item) {
				// let url="../../pagesC/login/login?urladd=jobinfo&id="+this.oid
				console.log('传过来的值是=1111===', item.data.id)
				console.log('你点到我了～～～小心点', item.data)
				uni.navigateTo({
					url: "/pagesB/jobinfo/jobLeavetwoInfo?cardID=" + item.data.id
				})
				uni.setStorage({
					key: 'cardID',
					data: item.data.id,
					success: () => {
						console.log('存入成功')
					}
				})
			},
			playtel(item) {
				uni.makePhoneCall({
					phoneNumber: item.contractsMobile,
					success: function() {
						console.log('拨打电话成功！');
					},
					fail: function() {
						console.log('拨打电话失败！');
					}
				});
			},
			getList(pageNo, pageSize) {
				let send = {
					pageNum: pageNo,
					pageSize: pageSize,
					"type": this.type,
				}
				index.getPublicMember(send, 'client/recuitjob/listNoSe', 'get', res => {
					this.dataList = res.data.result.records;
					this.$refs.paging.complete(res.data.result.records)
				})
			},
			onShareAppMessage(res) {
				if (res.from === 'button') { // 来自页面内分享按钮
				}
				return {
					title: '【天下工人】',
					path: '/pagesB/jobinfo/jobLeavetwo?' + '&index=' + uni.getStorageSync('index'),
					imageUrl: 'http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230327160119.png'
				}
			},
			onShareTimeline(res) {
				return {
					title: '【天下工人】',
					path: '/pagesB/jobinfo/jobLeavetwo?' + '&index=' + uni.getStorageSync('index'),
					imageUrl: 'http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230327160119.png'
				}
			}
		}
	}
</script>
<style>
	@import url("@/static/css/publics.css");
	@import url("@/static/css/myfollow.css");
</style>
<style lang="scss">
	page {
		width: 100%;
		height: 100%;
		background-color: #ffffff;
	}
</style>